# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=calligra
pkgver=3.2.1
pkgrel=0
pkgdesc="Office and graphic art suite by KDE"
arch="all !armhf !mips !mips64" # qtdeclarative
url="https://calligra.org"
license="GPL-2.0-or-later AND LGPL-2.0-only"
makedepends="extra-cmake-modules qt5-qtbase-dev qt5-qtsvg-dev qt5-qtdeclarative-dev qt5-qtquickcontrols2-dev qt5-qtx11extras-dev karchive-dev kcodecs-dev kcompletion-dev kconfig-dev kconfigwidgets-dev kcoreaddons-dev kdbusaddons-dev kdoctools-dev kguiaddons-dev ki18n-dev kiconthemes-dev kitemviews-dev kjobwidgets-dev kcmutils-dev kdelibs4support-dev kio-dev kross-dev knotifications-dev knotifyconfig-dev kparts-dev sonnet-dev ktextwidgets-dev kwallet-dev kwidgetsaddons-dev kwindowsystem-dev kxmlgui-dev kactivities-dev attica-dev knewstuff-dev boost-dev threadweaver-dev poppler-qt5-dev kdiagram-dev eigen-dev"
# Dependencies for extra features
makedepends="$makedepends libgit2-dev libodfgen-dev libvisio-dev libwpg-dev okular-dev"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/calligra/$pkgver/calligra-$pkgver.tar.xz"
subpackages="$pkgname-doc $pkgname-lang"
options="!check" # Broken tests https://bugs.kde.org/show_bug.cgi?id=423989

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DGHNS=ON
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="e53a939aa1b277c2291cfd626868c77085fc9cc7774df160b5b1afceb33314b4381fa8ffe03636cbde6e35cc2abd170a51e7f9c1a99191339313b9c9c3b1526f  calligra-3.2.1.tar.xz"
